/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jhu.profiteer.data;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.EmbeddedId;

/**
 *
 * @author Jeremy
 */
@Entity
public class CurrentCommodityValue implements Serializable {
  private static final long serialVersionUID = 1L;
  private CurrentCommodityValuePK id;
  private Long price;

  /**
   * @return the price
   */
  public Long getPrice() {
    return price;
  }

  /**
   * @param price the price to set
   */
  public void setPrice(Long price) {
    this.price = price;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (null != id ? id.hashCode() : 0) +
            (null != price ? price.hashCode() : 0);
    return hash;
  }

  @Override
  public boolean equals(Object object) {
    if (!(object instanceof CurrentCommodityValue)) {
      return false;
    }
    CurrentCommodityValue other = (CurrentCommodityValue) object;
    if ((null == this.id && null != other.id) ||
        (null != this.id &&
         !this.id.equals(other.id))) {
      return false;
    }
    if ((null == this.price && null != other.price) ||
        (null != this.price && !this.price.equals(other.price))) {
      return false;
    }
    return true;
  }

  @Override
  public String toString() {
    return "jhu.profiteer.data.CurrentCommodityValue[id=" + id +
           ", price=" + price + "]";
  }

  /**
   * @return the id
   */
  @EmbeddedId
  public CurrentCommodityValuePK getId() {
    return id;
  }

  /**
   * @param id the id to set
   */
  public void setId(CurrentCommodityValuePK id) {
    this.id = id;
  }

}
